package com.yjian.dao.bean;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * Created by xuxiaobao on 2017/9/27.
 */
public class User {
    private Long id;
    private String uid;
    private String phone;
    private String password;
    private Long createTime;

    @JsonIgnore
    private String query_sql;

    public void initQuerySql(boolean uid, boolean phone, boolean password, boolean createTime) {
        StringBuilder sb = new StringBuilder();
        sb.append("id,");
        if (uid) sb.append("uid,");
        if (phone) sb.append("phone,");
        if (password) sb.append("password,");
        if (createTime) sb.append("createTime,");
        sb.replace(sb.lastIndexOf(","),sb.length(), "");

        query_sql = sb.toString();
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public String getQuery_sql() {
        return query_sql;
    }
}
